package com.javaGather.demo3;

import java.util.HashSet;
import java.util.Random;

public class Test7 {
    public static void main(String[] args) {

        HashSet<Integer> integers = new HashSet<>();

        Random random = new Random();
        while (integers.size() < 10) {
            int i = random.nextInt(20) + 1;
            integers.add(i);
        }
        System.out.println("-----------------");
        for (Integer integer : integers) {
            System.out.println(integer);
        }

    }
}
